home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
utility
/
clustr.zip
/
CLUSTER.BAS
next >
Wrap
BASIC Source File
|
1993-11-19
|
32KB
|
993 lines
'*****************************CLUSTER.BAS*******************************
'
'I'm Getting a 535 MB Hard drive. Want to know how to use FDISK.EXE to
'partition it most effectively. Most files are NOT 8K (8192 bytes) long
'and only one file fits per cluster. Using 8K Clusters on a 100 MB drive
'gave me 12 MB (sic) of "Slack Space"; Using MS-DOS 5.0 (or greater)
'with FDISK.EXE and reformating the drive gave me 2 K Clusters and regained
'6 MegaBytes of disk space... Worth doing.... If you are the fearless type
'and have really and truly backed up your hard drive to TWO tapes and run
'the tape compare on BOTH of them.
'
'John De Palma on CompuServe 76076,571
'11/12/93
'WOW!!!! 66 K executable file size.... This is a job for PDQ!
'
'Ouch!!!
'can't compile with PDQ because of:
'Exteral error with Setborder because it was in BORDER2.BAS with a
'different TYPE declaration, putting it here makes it work!, now to fix
'the next two errors
'B$USNG error "Print Using" <--- fixed by using FUsing Function
'B$POW4 error "Raising a number to a power" <--- fixed by using Power Function
'fixed the SETBORDER ERROR had to change the USER DEFINED TYPE to the
'PDQ one and make it a sub here, though not sure that was necessary
'11/13/93
'Ouch...ouch ouch!! TAB() doesn't work right with PDQ, had to excise
'all tabs and substitute spaces...
'
'11/16/93
'Call to Ethan Winer, QuickPAK library doesn't contain CALL INTERRUPT...
'Ethan called back...
'Now to learn about LIB.EXE...., ugh!
'11/17/93
'NOW Have ALL the PDQ.QLB routines merged into PDQPRO.QLB which is loaded
'with this file. It works. The errors so far are:
'
'1. Mistyped Function names in DECLARE.BAS (not my fault)
' get "program undefined" error
'
'2. Forgetting to LOAD Basic SUBS and FUNCTIONS that are NOT
' QuickPAK Assembly functions, get "program undefined" error
'
'So far so good... no real problems, lots of typos, but what the hey...
'Declarations and non executable code follows
'$INCLUDE: 'c:\qb45\pdq\PDQDECL.BAS' 'this is PDQ's INCLUDE file
DEFINT A-Z 'absolutely essential for the assembly language calls!
CONST False = 0, True = -1
CONST row% = 2
'QuickPak Routines 'all of these can be done in QuickBASIC
DECLARE FUNCTION GetDrive% ()
DECLARE FUNCTION GetDir$ (Drive$)
DECLARE FUNCTION ASCII% (Work$)
DECLARE FUNCTION Exist% (FileName$)
DECLARE SUB BLPrint (LPTNo, X$, ErrCount) 'LPRINT doesn't work in PDQ
'DECLARE SUB Pause (Ticks%) 'a dup definition, in PDQ's declare file
'name of this next function was MISPELLED in QuickPAK's DECLARE.BAS
'got a Program undefined error... real problem to figure out
'good lesson "trust no one, suspect everyone, shoot on sight!"
'check spelling first with that error
'DECLARE FUNCTION ParseString$ (CurPos%, Work$, Delimit$)
' Functions for ReadText SUB 'this is from READ.COM
DECLARE FUNCTION KeyCode% ()
' Subprograms fir ReadText SUB
DECLARE SUB FileRead (FileName$, LineCount%, a$())
DECLARE SUB ParseWords (FileName$, Drive$, File$, Ext$)
' Dimension string array
' DIM a$(1 TO 2000)
TYPE disks
SectorsPerCluster AS INTEGER
BytesPerSector AS INTEGER
clustersPerDrive AS LONG
AvailableClusters AS LONG
availableBytes AS LONG
END TYPE
'SUBs & FUNCTIONs in CLUSTER.BAS
DECLARE SUB SetBorder (ColrByte%)
DECLARE SUB ScreenOne (row2%, col2%)
DECLARE SUB ScreenOpen ()
DECLARE SUB GetDiskFreeSpace (Drive$, ClusterSize%)
DECLARE SUB ReadText (FileName$)
DECLARE SUB ParseDisk (Mega%, ClusterSize%, Drive$)
DECLARE SUB ToPrint (Mega%, ClusterSize%)
DECLARE FUNCTION Choice% (YN$)
DECLARE SUB WannaPrint (Mega%, ClusterSize%)
DECLARE SUB WhereIsHelpFile (FileName$)
DECLARE FUNCTION Center% (text$)
'executable code starts here
OPTION BASE 1 'for the array of disk drive names
SCREEN 0
WIDTH 80
COLOR 15, 1
CLS
FileName$ = "CLUSTER.DOC"
CALL WhereIsHelpFile(FileName$)
'STOP
'this is a PDQ function to do exponents
'in QuickBASIC it would be KiloByte&= 2^10
KiloByte& = Power2&(10)
MegaByte& = Power2&(20)
EightKCluster& = Power2&(13)
FourKCluster& = Power2&(12)
TwoKCluster& = Power2&(11)
CALL ScreenOpen
CALL SetBorder(13)
'gets information about your C: Drive
'STOP 'like STOP better than BreakPoint
Drive$ = CHR$(GetDrive%) + ":"
CALL GetDiskFreeSpace(Drive$, ClusterSize%)
'PRINT ClusterSize%
text$ = "Do you FIRST want to read the text file???"
LOCATE row% + 16, Center(text$)
COLOR 11, 1
PRINT text$
text$ = "PRESS 'Y' for YES if you do"
LOCATE row% + 17, Center(text$)
PRINT text$
text$ = "-OR- any other key for NO to RUN the PROGRAM..."
LOCATE row% + 20, Center(text$)
PRINT text$
COLOR 7, 0
text$ = " "
LOCATE row% + 18, Center(text$), 1, 4, 7
PRINT text$
LOCATE row% + 18, Center(text$)
'STOP
IF Choice(YN$) THEN
CALL ReadText(FileName$)
ELSE
END IF
AnotherDrive:
CALL SetBorder(14)
COLOR 15, 1
CLS
LOCATE , , 0
text$ = "Cluster Size versus Hard Drive Size"
LOCATE row%, Center(text$), 0
COLOR 11, 0: PRINT text$
text$ = " -THINGS- You Need to Know about Clusters... "
LOCATE row% + 1, Center(text$)
COLOR 11, 2: PRINT text$
text$ = " Or... How to Make 2K Clusters with BIG Hard Drives "
COLOR 11, 3: LOCATE row% + 2, Center(text$)
PRINT text$
'STOP
COLOR 15, 1
LOCATE row% + 4, 10
PRINT "One KiloByte equals: "; KiloByte&; " bytes"
LOCATE row% + 5, 10
PRINT "One MegaByte equals: ";
'using PDQ function note IMAGE$ format for commas
PRINT FUsing$(STR$(MegaByte&), "#########,")
LOCATE row% + 7, 10
PRINT "Eight K Cluster equals: "; EightKCluster&; " bytes"
LOCATE row% + 8, 10
PRINT "Four K Cluster equals: "; FourKCluster&
LOCATE row% + 9, 10
PRINT "Two K Cluster equals: "; TwoKCluster&;
LOCATE row% + 11, 10
PRINT "Eight K Clusters per MB is: "; MegaByte& / EightKCluster&; " Number"
LOCATE row% + 12, 10
PRINT "Four K Clusters per MB is: "; MegaByte& / FourKCluster&
LOCATE row% + 13, 10
PRINT "Two K Clusters per MB is: "; MegaByte& / TwoKCluster&
'use integer divisor to round down
LOCATE row% + 15, 10
PRINT "Max Hard disk size with 2 MB clusters is: "; : COLOR 11, 1: PRINT 65518 \ (MegaByte& / TwoKCluster&); : COLOR 15, 1: PRINT " MB"
COLOR 15, 1
LOCATE row% + 16, 10
PRINT "Max Hard disk size with 4 MB clusters is: "; 65518 \ (MegaByte& / FourKCluster&); " MB"
LOCATE row% + 17, 10
PRINT "Max Hard disk size with 8 MB clusters is: "; 65518 \ (MegaByte& / EightKCluster&); " MB"
text$ = " Your " + Drive$ + " Drive Cluster Size is: >>" + STR$(ClusterSize%) + " << "
LOCATE row% + 14, Center(text$)
COLOR 15, 4: PRINT " Your " + Drive$ + " Drive Cluster Size is: >>";
COLOR 15 + 16, 4: PRINT STR$(ClusterSize%);
COLOR 15, 4: PRINT " << "
text$ = "View another Drive Cluster Statistics?..."
LOCATE row% + 19, Center(text$)
COLOR 14, 6: PRINT text$
text$ = "PRESS 'Y' for YES, -or- another Key to Go on...."
LOCATE row% + 21, Center(text$)
PRINT text$;
COLOR 7, 0
text$ = " "
LOCATE row% + 20, Center(text$), 1, 4, 7
PRINT text$
LOCATE row% + 20, Center(text$)
'STOP
WHILE INKEY$ <> "": WEND 'clear keyboard
'Again:
IF Choice(YN$) THEN
COLOR 15, 3
CLS
SetBorder (11)
CALL ScreenOpen
'STOP
text$ = "What Drive Statistics do you Want???"
LOCATE row% + 16, Center(text$)
COLOR 11, 1
PRINT text$
text$ = " PRESS the drive LETTER, ie: 'A' or 'B' or 'C'.... "
LOCATE row% + 18, Center(text$)
PRINT text$
COLOR 7, 0
text$ = " "
LOCATE row% + 18, Center(text$), 1, 4, 7
PRINT text$
LOCATE row% + 18, Center(text$)
Drive$ = INPUT$(1)
LOCATE , , 0
Drive$ = UCASE$(Drive$)
PRINT Drive$
'didn't put in error checking in case you entered a drive you don't have
'just to see what happens, all that happens is you get a zero
'cluster size but some weird number for total number of clusters on
'that non existant drive...
CALL GetDiskFreeSpace(Drive$, ClusterSize%)
PAUSE (18)
COLOR 15, 4
text$ = "PRESS any key to CONTINUE the PROGRAM..."
LOCATE row% + 20, Center(text$)
PRINT text$
WHILE INKEY$ <> "": WEND 'clear keyboard
DO
kee$ = INKEY$
LOOP UNTIL LEN(kee$) 'pause
GOTO AnotherDrive
ELSE
END IF
'LOCATE , , 1
TryAgain:
CALL SetBorder(11)
CALL ScreenOne(row2, col2)
LOCATE row2, col2, 1, 4, 7
COLOR 7, 0
'STOP
INPUT "", Mega$
Mega% = VAL(Mega$)
IF Mega$ = "" THEN
SetBorder (0)
LOCATE , , 1, 6, 7
END
ELSEIF Mega% <= 0 OR Mega% > 2921 THEN
BEEP
GOTO TryAgain
ELSE
END IF
'PRINT Mega%
CALL SetBorder(4)
CALL ParseDisk(Mega%, ClusterSize%, Drive$)
'GOTO Again
'This file was last compiled with:
'BC C:\QB45\PDQ\CLUSTRP2.BAS /o;
'LINK CLUSTRP2+
' C:\QB45\PDQ\_CPRINT+
' /nod /noe /packcode /far
'
' nul
' C:\QB45\PDQ\PRO C:\QB45\PDQ\PDQ
'
'------------------ 00:17 AM 11/17/93 -----------------------------
'This file was last compiled with:
'BC C:\QB45\PDQ\CLUS_PDQ.BAS /o;
'LINK CLUS_PDQ+
' C:\QB45\PDQ\_CPRINT+
' /nod /noe /packcode /far /ex
'
' nul
' C:\QB45\PDQ\PRO C:\QB45\PDQ\PDQ
'This file was last compiled with:
'BC C:\QB45\PDQ\CLUSTER.BAS /o;
'LINK CLUSTER+
' C:\QB45\PDQ\_CPRINT+
' /nod /noe /packcode /far
'
' nul
' C:\QB45\PDQ\PRO C:\QB45\PDQ\PDQ
'This file was last compiled with:
'BC C:\QB45\PDQ\CLUSTER.BAS /o;
'LINK CLUSTER+
' C:\QB45\PDQ\_CPRINT+
' /nod /noe /packcode /far /ex
'
' nul
' C:\QB45\PDQ\PRO C:\QB45\PDQ\PDQ
FUNCTION Center (text$)
Center = 41 - LEN(text$) \ 2
END FUNCTION
FUNCTION Choice (YN$)
YN$ = INPUT$(1)
YN$ = UCASE$(YN$)
PRINT YN$
LOCATE , , 0
IF YN$ = "Y" THEN
Choice = True
ELSE
Choice = False
END IF
END FUNCTION
SUB FileRead (FileName$, LineCount%, a$()) STATIC
FileNumber% = FREEFILE
OPEN FileName$ FOR INPUT AS FileNumber%
FOR i% = LBOUND(a$) TO UBOUND(a$)
LINE INPUT #FileNumber%, a$(i%)
LineCount% = i%
IF EOF(FileNumber%) THEN
EXIT FOR
END IF
NEXT i%
IF NOT EOF(FileNumber%) THEN
LineCount% = True 'set EOF to -1 and avoids error
END IF
END SUB
SUB GetDiskFreeSpace (Drive$, ClusterSize%)
' from John C Craig's Toolbox
DIM disk AS disks
'STOP
DIM reg AS RegType
IF Drive$ <> "" THEN
Drive% = ASC(UCASE$(Drive$)) - 64
ELSE
Drive% = 0
END IF
IF Drive% >= 0 THEN
reg.DX = Drive%
ELSE
reg.DX = 0
END IF
reg.AX = &H3600
CALL Interrupt(&H21, reg)
disk.SectorsPerCluster = reg.AX
disk.BytesPerSector = reg.CX
IF reg.DX >= 0 THEN
disk.clustersPerDrive = reg.DX
ELSE
disk.clustersPerDrive = reg.DX + 65536
END IF
IF reg.BX >= 0 THEN
disk.AvailableClusters = reg.BX
ELSE
disk.AvailableClusters = reg.BX + 65536
END IF
disk.availableBytes = disk.AvailableClusters * reg.AX * reg.CX
COLOR 14, 6
'if I use ClusterSize% to print here it doesn't work
ClusterSize% = disk.SectorsPerCluster * disk.BytesPerSector
text$ = " Drive Bytes per CLUSTER »»»" + STR$(disk.SectorsPerCluster * disk.BytesPerSector)
LOCATE row% + 8, Center(text$)
PRINT text$
text$ = " This DRIVE is »»» " + Drive$
LOCATE row% + 9, Center(text$)
COLOR 11, 0
PRINT text$
COLOR 14, 1
LOCATE row% + 11, 20
PRINT "Total Clusters on drive "; disk.clustersPerDrive
LOCATE row% + 12, 20
PRINT "Available Clusters "; disk.AvailableClusters
LOCATE row% + 13, 20
PRINT "Available Bytes "; 'disk.availableBytes
PRINT FUsing$(STR$(disk.availableBytes), "#############,")
LOCATE row% + 14, 20
DiskSize2& = disk.BytesPerSector * disk.clustersPerDrive * disk.SectorsPerCluster
PRINT "Total Disk Size ";
PRINT FUsing$(STR$(DiskSize2&), "##############,")
END SUB
FUNCTION KeyCode% STATIC
DO
k$ = INKEY$
LOOP UNTIL k$ <> ""
KeyCode% = CVI(k$ + CHR$(0))
END FUNCTION
SUB ParseDisk (Mega%, ClusterSize%, Drive$) STATIC
COLOR 15, 2
CLS
LOCATE , , 0
DIM Drive$(24)
FOR num = 1 TO 24
Drive$(num) = CHR$(66 + num)
' PRINT Drive$(num)
NEXT num
'ClusterSize% = 1024
SELECT CASE Mega%
CASE 1 TO 127
SELECT CASE ClusterSize%
CASE 512 TO 1024
text$ = "DRIVE STATISTICS ON: " + Drive$
LOCATE row%, Center(text$)
PRINT text$;
text$ = "You Really don't need my help...."
LOCATE row% + 2, Center(text$)
PRINT text$;
LOCATE row% + 4, Center(text$)
PRINT "Think this is a Floppy. Size is: "; STR$(Mega%)
LOCATE row% + 6, Center(text$)
PRINT "Cluster Size is:"; STR$(ClusterSize%)
CASE 2048
text$ = "DRIVE STATISTICS ON: " + Drive$
LOCATE row%, Center(text$)
PRINT text$;
text$ = "You Really don't need my help...."
LOCATE row% + 2, Center(text$)
PRINT text$;
LOCATE row% + 4, Center(text$)
PRINT "Hard Disk Size is: "; STR$(Mega%)
LOCATE row% + 6, Center(text$)
PRINT "Cluster Size is:"; STR$(ClusterSize%)
CASE 4096 TO 8916
text$ = "DRIVE STATISTICS ON: " + Drive$
LOCATE row%, Center(text$)
PRINT text$;
text$ = "USE FDISK.EXE with DOS 5.0 or Better...."
LOCATE row% + 2, Center(text$)
PRINT text$;
LOCATE row% + 4, Center(text$)
PRINT "Hard Disk Size is: "; STR$(Mega%)
LOCATE row% + 6, Center(text$)
PRINT "Cluster Size is:"; STR$(ClusterSize%)
CASE ELSE
text$ = "Uh....Something's WRONG here...."
LOCATE row% + 2, Center(text$)
PRINT text$;
LOCATE row% + 4, Center(text$)
PRINT "Hard Disk Size is: "; STR$(Mega%)
LOCATE row% + 6, Center(text$)
PRINT "Cluster Size is:"; STR$(ClusterSize%)
END SELECT
CASE 128 TO 2921
LOCATE row% - 1, 20
PRINT "FOR DRIVE " + Drive$; STRING$(10, 32); "Drive Size in MB"
NumberDrives% = Mega% \ 127
IF Mega% MOD 127 <> 0 THEN
NumberDrives% = NumberDrives% + 1
END IF
LOCATE row%, 10
PRINT STRING$(60, 205)
Temp% = Mega%
FOR n = 1 TO NumberDrives%
LOCATE row% + n, 20
'STOP
SELECT CASE Temp%
CASE IS > 127 + 15
DriveSize = 127
CASE IS < 127
DriveSize = Temp%
CASE 127
DriveSize = 127
CASE IS < 127 + 16
DriveSize = 127 - 16 + (Temp% MOD 127)
CASE ELSE
PRINT Temp%
BEEP
PRINT "BIG MISTAKE!... probably mine"
STOP
END SELECT
PRINT "Drive: "; Drive$(n); STRING$(17, 32); DriveSize;
Temp% = Temp% - DriveSize
NEXT n
CASE ELSE
text$ = "Uh.... The DRIVE Size is: " + STR$(Mega%)
LOCATE row% + 2, Center(text$)
PRINT text$
BEEP
END SELECT
WHILE INKEY$ = "": WEND
'STOP
CALL WannaPrint(Mega%, ClusterSize%)
CALL SetBorder(0)
LOCATE , , 1, 6, 7
END SUB
SUB ParseWords (FileName$, Drive$, File$, Ext$) STATIC
'this is clumsy, but it seems a fair way to parse a long full path
'to show a file name
ln = LEN(FileName$)
' first get the drive
colon = INSTR(FileName$, ":")
IF colon THEN
Drive$ = LEFT$(FileName$, colon)
END IF
' next erase a final backslash if it exists
IF RIGHT$(FileName$, 1) = "\" THEN
Temp$ = LEFT$(FileName$, ln - 1)
ln = ln - 1
ELSE
Temp$ = FileName$
END IF
' third get the Extension
FOR n = ln TO 1 STEP -1
Ext$ = MID$(Temp$, n)
IF INSTR(Ext$, ".") THEN
Ext$ = LEFT$(Ext$, 4)
Temp$ = LEFT$(Temp$, n - 1)
k = n
EXIT FOR
ELSE
Ext$ = ""
k = ln 'if there is no extension
END IF
NEXT n
'fourth get the file name but not more than 8 letters...
FOR n = k TO 1 STEP -1
File$ = MID$(Temp$, n)
IF INSTR(File$, "\") THEN
EXIT FOR
ELSE
File$ = MID$(Temp$, n)
IF LEN(File$) >= 8 THEN EXIT FOR
END IF
NEXT n
'fifth add a backslash to the file name
IF INSTR(File$, "\") = 0 THEN
File$ = "\" + File$
END IF
END SUB
SUB ReadText (FileName$)
' Key code numbers, use CVI function
CONST UPARROW = 18432
CONST DOWNARROW = 20480
CONST PGUP = 18688
CONST PGDN = 20736
CONST HOME = 18176
CONST ENDKEY = 20224
CONST ESCAPE = 27
' Functions
' DECLARE FUNCTION KeyCode% ()
' Subprograms
' DECLARE SUB FileRead (FileName$, lineCount%, a$())
' DECLARE SUB ParseWords (FileName$, Drive$, File$, Ext$)
' Dimension string array
DIM a$(1 TO 2000)
CALL ParseWords(FileName$, Drive$, File$, Ext$)
CALL FileRead(FileName$, LineCount%, a$())
' Screen zero
SCREEN 0
' Check for monochrome monitor, if true set colors for monochrome
DEF SEG = 0
IF PEEK(&H463) = &HB4 THEN '--PEEK to See Type of Monitor
DEF SEG = &HB000 '--MonoChrome Monitor(Memory Location)
Colr = 7
inverse = 112
BEEP
ELSE
Colr = 23
inverse = 48
DEF SEG = &HB800 '--Color Monitor(Memory Location)
END IF
CLS
CALL CursorOff
' Set line pointer
linePtr% = 1
' Main loop
DO
' Print information bar at top
CALL PDQPrint(" Line:" + LEFT$(STR$(linePtr%) + SPACE$(6), 7) + "File: " + LEFT$(Drive$ + File$ + Ext$ + SPACE$(19), 19) + "Quit: {Esc}" + SPACE$(1) + "Move: " + CHR$(24) + " " + CHR$(25) + " PgUp PgDn Home End ", 1, 1, inverse)
FOR i% = 0 TO 23
CALL PDQPrint(LEFT$(a$(i% + linePtr%) + SPACE$(80), 80), i% + 2, 1, Colr)
NEXT i%
' Wait for a meaningful key to be pressed
SELECT CASE KeyCode%
CASE UPARROW
IF linePtr% > 1 THEN
linePtr% = linePtr% - 1
END IF
CASE DOWNARROW
IF linePtr% < LineCount% THEN
linePtr% = linePtr% + 1
END IF
CASE PGUP
IF linePtr% > 1 THEN
linePtr% = linePtr% - 24
IF linePtr% < 1 THEN
linePtr% = 1
END IF
END IF
CASE PGDN
IF linePtr% < LineCount% - 24 THEN
linePtr% = linePtr% + 24
IF linePtr% > LineCount% THEN
linePtr% = LineCount%
END IF
END IF
CASE HOME
IF linePtr% > 1 THEN
linePtr% = 1
END IF
CASE ENDKEY
IF linePtr% < LineCount% - 24 THEN
linePtr% = LineCount% - 24
END IF
CASE ESCAPE
quitFlag% = True
CASE ELSE
updateFlag% = False
END SELECT
LOOP UNTIL quitFlag%
END SUB
SUB ScreenOne (row2, col2)
COLOR 15, 1
CLS
LOCATE 4, 1
PRINT " "; : COLOR 15, 4: PRINT "█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█";
COLOR 15, 1: PRINT " "; : PRINT " ";
COLOR 15, 4: PRINT "█ "; : COLOR 14, 4: PRINT "Hard Drive Partition Calculator ";
COLOR 15, 4: PRINT " █"; : COLOR 7, 0: PRINT " ";
COLOR 15, 1: PRINT " "; : PRINT " ";
COLOR 15, 4: PRINT "█ "; : COLOR 14, 4: PRINT " ";
COLOR 15, 4: PRINT " Use to determine Optimal Cluster size ";
COLOR 14, 4: PRINT " "; : COLOR 15, 4: PRINT " █";
COLOR 15, 0: PRINT " "; : COLOR 15, 1: PRINT " ";
PRINT " "; : COLOR 15, 4: PRINT "█";
COLOR 14, 4: PRINT " "; : COLOR 15, 4: PRINT " For Hard Drives of 127 to 2921 ";
COLOR 10, 4: PRINT "Megabytes"; : COLOR 15, 4: PRINT " ";
COLOR 14, 4: PRINT " "; : COLOR 15, 4: PRINT "█";
COLOR 15, 0: PRINT " "; : COLOR 15, 1: PRINT " ";
PRINT " "; : COLOR 15, 4: PRINT "█ █";
COLOR 15, 0: PRINT " "; : COLOR 15, 1: PRINT " ";
PRINT " "; : COLOR 15, 4: PRINT "█ Enter the SIZE in ";
COLOR 14, 4: PRINT "MEGABYTES"; : COLOR 15, 4: PRINT " of your HARD";
COLOR 11, 4: PRINT " "; : COLOR 15, 4: PRINT "DRIVE █";
COLOR 15, 0: PRINT " "; : COLOR 15, 1: PRINT " ";
PRINT " "; : COLOR 15, 4: PRINT "█";
COLOR 11, 4: PRINT "───────────────────────────────────────────────────────────────";
COLOR 15, 4: PRINT "█"; : COLOR 15, 0: PRINT " ";
COLOR 15, 1: PRINT " "; : PRINT " ";
COLOR 15, 4: PRINT "█ █";
COLOR 15, 0: PRINT " "; : COLOR 15, 1: PRINT " ";
PRINT " "; : COLOR 15, 4: PRINT "█";
COLOR 14, 4: PRINT " "; : COLOR 15, 4: PRINT " ";
COLOR 14, 4: PRINT " "; : COLOR 15, 4: PRINT " ";
COLOR 10, 4: PRINT "Hard Drive Size:"; : COLOR 15, 4: PRINT " ";
row2 = CSRLIN
col2 = POS(0)
COLOR 7, 0: PRINT " "; : COLOR 15, 4: PRINT " ";
COLOR 14, 4: PRINT " 1 to 4 numbers... ONLY! ";
COLOR 15, 4: PRINT " █"; : COLOR 7, 0: PRINT " ";
COLOR 15, 1: PRINT " "; : PRINT " ";
COLOR 15, 4: PRINT "█ "; : COLOR 14, 4: PRINT " ";
COLOR 15, 4: PRINT " ";
COLOR 14, 4: PRINT " "; : COLOR 15, 4: PRINT " ";
COLOR 14, 4: PRINT "Please ";
COLOR 10, 4: PRINT " "; : COLOR 14, 4: PRINT " ";
COLOR 15, 4: PRINT " █"; : COLOR 15, 0: PRINT " ";
COLOR 15, 1: PRINT " "; : PRINT " ";
COLOR 15, 4: PRINT "█ "; : COLOR 14, 4: PRINT " No Commas NO periods ";
COLOR 15, 4: PRINT " █"; : COLOR 15, 0: PRINT " ";
COLOR 15, 1: PRINT " "; : PRINT " ";
COLOR 15, 4: PRINT "█ "; : COLOR 14, 4: PRINT " ";
COLOR 15, 4: PRINT " "; : COLOR 14, 4: PRINT " ";
COLOR 15, 4: PRINT " █";
COLOR 15, 0: PRINT " "; : COLOR 15, 1: PRINT " ";
PRINT " "; : COLOR 15, 4: PRINT "█ ";
COLOR 14, 4: PRINT " "; : COLOR 15, 4: PRINT "(PRESS {Enter when done)";
COLOR 14, 4: PRINT " "; : COLOR 15, 4: PRINT " █";
COLOR 7, 0: PRINT " "; : COLOR 15, 1: PRINT " ";
PRINT " "; : COLOR 15, 4: PRINT "█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█";
COLOR 15, 0: PRINT " "; : COLOR 15, 1: PRINT " ";
PRINT " "; : COLOR 7, 0: PRINT " ";
COLOR 8, 0: PRINT "John De Palma on CompuServe 76076,571 ";
COLOR 7, 0: PRINT " "; : COLOR 15, 1: PRINT " ";
END SUB
SUB ScreenOpen
COLOR 15, 1
LOCATE row%, 1
PRINT " ▐▐▐▐ ▐▐▐ ▐ ";
PRINT " ▐▐ ▐▐ ▐▐ ▐▐ ";
PRINT " ▐▐ ▐▐ ▐▐ ▐▐ ▐▐▐▐▐ ▐▐▐▐▐ ▐▐▐▐ ▐▐ ▐▐▐ ▐▐▐▐▐ ";
PRINT " ▐▐ ▐▐ ▐▐ ▐▐ ▐▐ ▐▐ ▐▐ ▐▐ ▐▐▐ ▐▐ ▐▐ ";
PRINT " ▐▐ ▐▐ ▐▐ ▐▐ ▐▐▐▐ ▐▐ ▐▐▐▐▐▐ ▐▐ ▐▐ ▐▐▐▐ ";
PRINT " ▐▐ ▐▐ ▐▐ ▐▐ ▐▐ ▐▐ ▐▐ ▐ ▐▐ ▐▐ ▐▐ ";
PRINT " ▐▐▐▐ ▐▐▐▐ ▐▐▐ ▐▐ ▐▐▐▐▐ ▐▐ ▐▐▐▐ ▐▐▐▐ ▐▐▐▐▐ ";
PRINT " ";
END SUB
SUB SetBorder (ColrByte%) STATIC
DIM Regs AS RegType
Regs.AX = &H1001
Regs.BX = ColrByte% * &H100
CALL Interrupt(&H10, Regs)
END SUB
SUB ToPrint (Mega%, ClusterSize%)
DIM Drive$(24)
FOR num = 1 TO 24
Drive$(num) = CHR$(66 + num)
' PRINT Drive$(num)
NEXT num
'STOP
CR$ = CHR$(13) + CHR$(10)
Page$ = CHR$(12)
'Mega% = 126
'ClusterSize% = 4096
'CALL BLPrint(1, X$ + CR$ + Page$, errcount)
SELECT CASE Mega%
CASE 1 TO 127
FOR n = 1 TO 2
text$ = ""
CALL BLPrint(1, text$ + CR$, ErrCount)
NEXT
SELECT CASE ClusterSize%
CASE 2048
text$ = STRING$(10, 32) + "You Really don't need my help...."
CALL BLPrint(1, text$ + CR$, ErrCount)
text$ = STRING$(10, 32) + "Hard Disk Size is: " + STR$(Mega%)
CALL BLPrint(1, text$ + CR$, ErrCount)
text$ = STRING$(10, 32) + "Cluster Size is:" + STR$(ClusterSize%)
CALL BLPrint(1, text$ + CR$, ErrCount)
CASE 4096 TO 8916
text$ = STRING$(10, 32) + "USE FDISK.EXE with DOS 5.0 or Better...."
CALL BLPrint(1, text$ + CR$, ErrCount)
text$ = STRING$(10, 32) + "Hard Disk Size is: " + STR$(Mega%)
CALL BLPrint(1, text$ + CR$, ErrCount)
text$ = STRING$(10, 32) + "Cluster Size is:" + STR$(ClusterSize%)
CALL BLPrint(1, text$ + CR$, ErrCount)
CASE ELSE
text$ = STRING$(10, 32) + "MISTAKE HERE..."
CALL BLPrint(1, text$ + CR$, ErrCount)
END SELECT
CASE 128 TO 2921
text$ = ""
CALL BLPrint(1, text$ + CR$, ErrCount)
text$ = STRING$(20, 32) + "HARD DISK size to PARTITION is:[" + STR$(Mega%) + " ] MegaBytes"
CALL BLPrint(1, text$ + CR$, ErrCount)
text$ = ""
CALL BLPrint(1, text$ + CR$, ErrCount)
text$ = STRING$(20, 32) + "DRIVE LETTER" + STRING$(10, 32) + "Drive Size in MB"
CALL BLPrint(1, text$ + CR$, ErrCount)
text$ = STRING$(10, 32) + STRING$(60, "_")
CALL BLPrint(1, text$ + CR$, ErrCount)
text$ = ""
CALL BLPrint(1, text$ + CR$, ErrCount)
NumberDrives% = Mega% \ 127
IF Mega% MOD 127 <> 0 THEN
NumberDrives% = NumberDrives% + 1
END IF
Temp% = Mega%
FOR n = 1 TO NumberDrives%
LOCATE row% + n, 20
'STOP
SELECT CASE Temp%
CASE IS > 127 + 15
DriveSize = 127
CASE IS < 127
DriveSize = Temp%
CASE 127
DriveSize = 127
CASE IS < 127 + 16
DriveSize = 127 - 16 + (Temp% MOD 127)
CASE ELSE
PRINT Temp%
BEEP
PRINT "BIG MISTAKE!... probably mine"
STOP
END SELECT
text$ = STRING$(20, 32) + "Drive: " + Drive$(n) + STRING$(17, 32) + STR$(DriveSize)
CALL BLPrint(1, text$ + CR$, ErrCount)
Temp% = Temp% - DriveSize
NEXT n
CASE ELSE
text$ = ""
FOR n = 1 TO 10
CALL BLPrint(1, text$ + CR$, ErrCount)
NEXT
text$ = "Uh...." + STR$(Mega%) + " MB is -TOO BIG A DRIVE- to measure...."
CALL BLPrint(1, text$ + CR$, ErrCount)
END SELECT
FOR n = 1 TO 2
text$ = ""
CALL BLPrint(1, text$ + CR$, ErrCount)
NEXT
text$ = STRING$(25, 32) + "John De Palma on CompuServe 76076,571"
CALL BLPrint(1, text$ + CR$, ErrCount)
FOR n = 1 TO 2
text$ = ""
CALL BLPrint(1, text$ + CR$, ErrCount)
NEXT
text$ = STRING$(10, 32) + "Printing Line feed..."
CALL BLPrint(1, text$ + CR$ + Page$, ErrCount)
END SUB
SUB WannaPrint (Mega%, ClusterSize%)
COLOR 11, 0
col4 = 50
'STOP
LOCATE row% + 1, col4
PRINT "╒══════════════════════════╕"
LOCATE row% + 2, col4
PRINT "│ PRINT THIS OUTPUT ? │"
LOCATE row% + 3, col4
PRINT "│ │"
LOCATE row% + 4, col4
PRINT "│ PRESS 'Y' to Print │"
LOCATE row% + 5, col4
PRINT "│ │"
LOCATE row% + 6, col4
PRINT "│ any other key to EXIT │"
LOCATE row% + 7, col4
PRINT "│ │"
LOCATE row% + 8, col4
PRINT "╘══════════════════════════╛"
LOCATE row% + 7, col4 + 12, 1, 4, 7
'STOP
IF Choice(YN$) THEN
CALL ToPrint(Mega%, ClusterSize%)
ELSE
END IF
END SUB
SUB WhereIsHelpFile (FileName$)
Drive$ = CHR$(GetDrive%) + ":"
ThisDir$ = GetDir$(Drive$)
'FileName$ = "CLUSTER.DOC"
IF NOT Exist%(FileName$) THEN
SetBorder (4)
BEEP
text$ = " »»» " + FileName$ + " ««« "
LOCATE row% + 2, Center(text$)
COLOR 14, 6
PRINT text$
COLOR 15, 1
text$ = "Can't Find The »» HELP FILE «« in This Directory!"
LOCATE row% + 6, Center(text$)
PRINT text$
text$ = "This Drive & Directory is: "
LOCATE row + 8, Center(text$)
COLOR 11, 1
PRINT text$
text$ = Drive$ + ThisDir$
LOCATE row + 10, Center(text$)
COLOR 11, 0
PRINT text$
COLOR 15, 1
text$ = "Sorry... We need that file, Ending Program... "
LOCATE row + 12, Center(text$)
PRINT text$
FiveSeconds = 5 * 18
PAUSE (FiveSeconds)
SetBorder (0)
text$ = " Please Copy " + FileName$ + " to this Directory "
LOCATE row + 14, Center(text$)
COLOR 11, 0
PRINT " Please Copy ";
COLOR 15, 0
PRINT FileName$;
COLOR 11, 0
PRINT " to this Directory "
BEEP
END
END IF
END SUB
'This file was last compiled with:
'BC C:\QB45\PDQ\CLUSTER.BAS /o;
'LINK CLUSTER+
' C:\QB45\PDQ\_CPRINT+
' /nod /noe /packcode /far
'
' nul
' C:\QB45\PDQ\PRO C:\QB45\PDQ\PDQ
'This file was last compiled with:
'BC C:\QB45\PDQ\CLUSTER.BAS /o;
'LINK CLUSTER+
' C:\QB45\PDQ\_CPRINT+
' /nod /noe /packcode /far
'
' nul
' C:\QB45\PDQ\PRO C:\QB45\PDQ\PDQ